<%@ page import="com.xin.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: 鑫
  Date: 2022/3/14
  Time: 8:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>输出对象的属性</title>
</head>
<body>
     <%
         Person p=new Person();
         p.setName("name值");

         p.setPhones(new String[]{"100","101","102"});

         List<String> list=new ArrayList<>();
         list.add("北京");
         list.add("上海");
         list.add("杭州");
         p.setCitys(list);

         Map<String,Object> map=new HashMap<>();
         map.put("key1","key1Value");
         map.put("key2","key2Value");
         map.put("key3","key3Value");
         p.setMap(map);
         request.setAttribute("persontest",p);
     %>
     <%--测试EL表达式输出普通对象中的属性值--%>

     输出放到request域中的对象:${ persontest }<br/>
     输出属性:
            ${persontest.}<br/>
            ${requestScope.persontest.phones}<br/>
            ${requestScope.persontest.citys}<br/>
     ${persontest.map}<br/>
     <%--测试jsp表达式代码脚本输出对象的属性值--%>
     表达式脚本<br/>
     <%=request.getAttribute("persontest")%>   <%-- 表达式脚本不能输出属性值吗？？--%>


</body>
</html>
